#!/bin/bash
#自动化安装k8s集群
cd flannel
  docker load -i flannel.tar.gz
docker tag quay.io/coreos/flannel:v0.12.0-amd64 192.168.1.100:5000/flannel:v0.12.0-amd64
 docker push 192.168.1.100:5000/flannel:v0.12.0-amd64
#修改配置文件并安装
cat -n kube-flannel.yml | grep -E "flannel:v0.12.0-amd64|Network"
#128: "Network": "10.244.0.0/16",
#172: image: 192.168.1.100:5000/flannel:v0.12.0-amd64
#186: image: 192.168.1.100:5000/flannel:v0.12.0-amd64
#227-结尾: 删除
kubectl apply -f kube-flannel.yml
#验证结果
kubectl get nodes
#NAME        STATUS  ROLES   AGE     VERSION
#master      Ready   master  26h     v1.17.6
#node-0001   Ready   <none>  151m    v1.17.6
#node-0002   Ready   <none>  152m    v1.17.6
#node-0003   Ready   <none>  153m    v1.17.6

